package com.md.mapper;

import com.md.entity.myStudent;
import org.apache.ibatis.annotations.*;

import java.util.List;
@Mapper
public interface studentMapper {
    @Select("select * from student")
    List<myStudent> selectAll();
    @Select("select * from student where studentId = #{id}")
    myStudent selectOne(int id);
    @Select("select * from student where studentName like '%${name}%'")
    List<myStudent> selectByName(String name);
    @Insert("insert into student(studentName,className,classTeacher) values(#{studentName},#{className},#{classTeacher}) ")
    int add(myStudent myStudent);
    @Delete("delete from student where studentId = #{id}")
    int delete(int id);
    @Update("update student set studentName = #{studentName},className = #{className},classTeacher = #{classTeacher} where studentId = #{studentId}")
    int change(myStudent myStudent);
}
